package org.aepscolombia.platform.models.entity;
// Generated Jan 13, 2014 2:36:33 PM by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * SowingTypes generated by hbm2java
 */
@Entity
@Table(name="sowing_types"
    ,catalog="madr_bd10"
)
public class SowingTypes  implements java.io.Serializable {


     private Integer idSowTyp;
     private String nameSowTyp;
     private boolean statusSowType;
     private Set cropsTypeses = new HashSet(0);
     private Set sowings = new HashSet(0);

    public SowingTypes() {
    }

	
    public SowingTypes(String nameSowTyp, boolean statusSowType) {
        this.nameSowTyp = nameSowTyp;
        this.statusSowType = statusSowType;
    }
    public SowingTypes(String nameSowTyp, boolean statusSowType, Set cropsTypeses, Set sowings) {
       this.nameSowTyp = nameSowTyp;
       this.statusSowType = statusSowType;
       this.cropsTypeses = cropsTypeses;
       this.sowings = sowings;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id_sow_typ", unique=true, nullable=false)
    public Integer getIdSowTyp() {
        return this.idSowTyp;
    }
    
    public void setIdSowTyp(Integer idSowTyp) {
        this.idSowTyp = idSowTyp;
    }
    
    @Column(name="name_sow_typ", nullable=false, length=45)
    public String getNameSowTyp() {
        return this.nameSowTyp;
    }
    
    public void setNameSowTyp(String nameSowTyp) {
        this.nameSowTyp = nameSowTyp;
    }
    
    @Column(name="status_sow_type", nullable=false)
    public boolean isStatusSowType() {
        return this.statusSowType;
    }
    
    public void setStatusSowType(boolean statusSowType) {
        this.statusSowType = statusSowType;
    }
@ManyToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    @JoinTable(name="sowing_types_crops_types", catalog="madr_bd10", joinColumns = { 
        @JoinColumn(name="id_sowing_type_sow_typ_cro", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="id_crop_type_sow_typ_cro", nullable=false, updatable=false) })
    public Set getCropsTypeses() {
        return this.cropsTypeses;
    }
    
    public void setCropsTypeses(Set cropsTypeses) {
        this.cropsTypeses = cropsTypeses;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="sowingTypes")
    public Set getSowings() {
        return this.sowings;
    }
    
    public void setSowings(Set sowings) {
        this.sowings = sowings;
    }




}


